//import ODOO from './odoojs-finance'

import ODOO from 'odoojs-finance'

const host = 'http://192.168.56.101:8069';
//const host = 'http://192.168.56.102:8069';

//const host = 'http://www.bjssrs.cn:8069';
const db = 'T3';

const error = ({url, params, error})=>{
    console.log('rpc call url:', url);
    console.log('rpc call params:', params);
    console.log('rpc call error:',  Object.keys( error) );
    console.log('rpc call error:',  error);

    Object.keys(error).forEach(item=>{
        console.log( item, error[item] );
    })

}

const success = ({url, params, result})=>{
    console.log('rpc call url:', url);
    console.log('rpc call params:', params);
    if(Array.isArray(result) ){
      console.log('rpc call result is array, length=',result.length );
    }
    else{
      console.log('rpc call result:',  result);
    }
}

const odoo = ODOO({ host, db, // success, error
} );

export default odoo


